import request from '@/utils/request'

// 查询消息通知列表
export function listMessages(query) {
  return request({
    url: '/message/messages/list',
    method: 'get',
    params: query
  })
}

// 查询消息通知详细
export function getMessages(id) {
  return request({
    url: '/message/messages/' + id,
    method: 'get'
  })
}

// 新增消息通知
export function addMessages(data) {
  return request({
    url: '/message/messages',
    method: 'post',
    data: data
  })
}

// 修改消息通知
export function updateMessages(data) {
  return request({
    url: '/message/messages',
    method: 'put',
    data: data
  })
}

// 删除消息通知
export function delMessages(id) {
  return request({
    url: '/message/messages/' + id,
    method: 'delete'
  })
}

// 消息状态修改
export function changeNoticeStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/message/messages/changeStatus',
    method: 'put',
    data: data
  })
}
